package com.lijian.controller;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lijian.common.easyui.datagrid.EasyuiDataGridResult;
import com.lijian.common.utils.TaotaoResult;
import com.lijian.service.ItemParamService;

/**
 * <p>Title: ItemParamController.java</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2017</p>
 * @author lijian
 * @date 2017年3月26日下午2:16:26
 * @version 1.0
 */
@Controller
@RequestMapping("/item/param")
public class ItemParamController {
	@Autowired
	private ItemParamService itemParamService;
	
	@RequestMapping("/query/itemcatid/{cid}")
	@ResponseBody
	public TaotaoResult getItemCatByCid(@PathVariable Long cid){
		return itemParamService.getItemParamByCid(cid);
	}
	@RequestMapping("/save/{cid}")
	@ResponseBody
	public TaotaoResult save(@PathVariable Long cid,@Param(value = "paramData") String paramData){
		return itemParamService.insertItemParam(cid, paramData);
	}
	@RequestMapping(value="/list",method=RequestMethod.GET)
	@ResponseBody
	public EasyuiDataGridResult list(Integer page, Integer rows){
		return itemParamService.getItemParamList(page,rows);
	}
	
}
